<!DOCTYPE html>
<html lang="cz">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 200px;
            height: 200px;
        }

        .box1{
            background-color: aqua;
            border: 1px solid red;
        }
        .box2{
            background-color: blue;
            border: 1px solid red;
            margin-top: 10px;
            /* margin 可设置四个边距  四个方向都一样 背景色没有蔓延*/
        }
        .box3{
            background-color: rebeccapurple;
            border: 1px solid red;
            width: 100px;
            height: 100px;
            margin-top: 10px;
            margin-left: -10px;
            margin: 0 auto;
        }
        
        /* 外边距可以设置负值 
            屏幕居中方案
            margin: 0 auto; 
            横向居中方案 
        */


    </style>

</head>
<body>
    <h1>ssssssssss</h1>
    
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>


</body>
</html>